﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BadmintonBuddy.Models.Club>>" %>
<%@ Import Namespace="BadmintonBuddy.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <% var item = Model.First();%>
    <%= Html.Encode(item.ClubName) %>-<%= Html.Encode(item.City.CityName) %>
    , Play Badminton in
    <%= Html.Encode(item.City.CityName) %>
    , Badminton courts in
    <%= Html.Encode(item.City.CityName)%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var item = Model.First(); %>
    
    <% Html.RenderPartial("SearchForm", Model); %>    
    <div class="detailsparent">
        <div id="detailscontainer">
            <div id="details">
                <h1 class="detailshead">
                    <%= Html.Encode(item.ClubName)%>
                </h1>
            </div>
            <fieldset>
                <legend>Description</legend>
                <div class="detailsinfo">
                    <ul class="courtdesc">
                        <li><b>Surface :</b>
                            <% switch (item.Surface)
                               {
                                   case 0: break;
                                   case 1: %>
                            Wooden<% break;
               case 2: %>
                            Syntetic
                            <% break;
               case 3:%>
                            Cement with Mat<% break;
               case 4: %>
                            Cement
                            <% break;
               case 5: %>
                            Cement Floor
                            <% break;
               case 6: %>
                            Other Surface
                            <% break; %>
                            <%} %>
                        </li>
                        <li><b>Number of Courts :</b><%= Html.Encode(item.Courts)%></li>
                        <li><b>Other Facilities :</b><%= Html.Encode(item.Description)%></li>
                    </ul>
                </div>
            </fieldset>
            <fieldset>
                <legend>Address</legend>
                <div class="detailsinfo">
                    <%= Html.Encode(item.Address)%>,<br />
                    <%= Html.Encode(item.City.CityName)%>,<%: item.City.State.StateName %>
                    -
                    <%: item.Zipcode %>
                </div>
                <div style="width: 36%; float: right;" class="button">
                    <a target="_blank" style="" class="green floatr" href="http://maps.google.com/maps?daddr=<%= Html.Encode(item.Latitude) %>,<%= Html.Encode(item.Longitude) %>&saddr=">
                        Get Directions</a></div>
            </fieldset>
            <!--fieldset><legend>City</legend>
        <div class="detailsinfo">
            ,            
            <%= Html.Encode(item.City.State.StateName) %>,
            <%= Html.Encode(item.City.State.Country.CountryName) %>
        </div> 
        </fieldset-->
            <fieldset>
                <legend>PhoneNumber</legend>
                <div class="detailsinfo">
                    <%= Html.Encode(item.PhoneNumber)%></div>
            </fieldset>
            <fieldset>
                <legend>Website</legend>
                <div class="detailsinfo">
                    <a href="<%= Html.Encode(item.Website) %>" target="_blank">
                        <%= Html.Encode(item.Website)%></a></div>
            </fieldset>
            <fieldset>
                <legend>Email</legend>
                <div class="detailsinfo">
                    <%= Html.Encode(item.Email)%></div>
            </fieldset>
            <fieldset>
                <legend>Fees</legend>
                <div class="detailsinfo">
                    <%= Html.Encode(item.Fees)%></div>
            </fieldset>
            <fieldset>
                <legend>Timings</legend>
                <div class="detailsinfo">
                    <%= Html.Encode(item.Timings)%></div>
            </fieldset>
            <div class="floatr">
                <a href="javascript:reportProblem();">Wrong Information or know more information?Help us fix</a>
            </div>
            <%= Html.Hidden("Lat", item.Latitude)%>
            <%= Html.Hidden("Lon", item.Longitude)%>
            <%= Html.Hidden("ClubID", item.ClubID)%>
        </div>
        <div class="rtcolumn">
            <div>
                <div id="mapDiv" class="mapDivDetail">
                </div>
            </div>
            <% if (Model.Count() != 1)
               {%>            
            <div class="related">
                <%  IEnumerable<BadmintonBuddy.Models.Club> relatedClubs = Model.Skip(1); %>
                <div class="relatedhead">
                    <span>Other clubs in
                        <%: Model.First().City.CityName%></span>
                </div>
                <% var count = 0; %>
                <% foreach (var relatedItem in relatedClubs)
                   { %>
                <% if (count < 2)
                   { %>
                <div class="relatedclubs">
                    <span class="name">
                        <%: relatedItem.ClubName%></span>
                    <div class="address">
                        <%: relatedItem.Address%>
                        <div>
                            <%:relatedItem.City.CityName%>,
                            <%: relatedItem.City.State.StateName%>
                            -
                            <%: relatedItem.Zipcode%></div>
                    </div>
                    <div class="button" style="width: 36%; float: right; padding-bottom: 5px;">
                        <a href="<%:relatedItem.ClubName.Replace(" ","-") %>" class="green">More info »</a>
                    </div>
                </div>
                <div class="seperate">
                </div>
                <% count++;%>
                <%} %>
                <% if (count == 2)
                   { %>
                <% var link = "/Search?q=" + relatedItem.City.CityName + "&filter=0";%>
                <div>
                    <a href="<%:link %>" class="morelink pdt10">more clubs in
                        <%:relatedItem.City.CityName%></a></div>
                <%break; %>
                <%} %>
                <%} %>
            </div>
            <%} %>            
        </div>
    </div>
    <div class="dispn report">
        <textarea id="report" cols="40" rows="8"></textarea>
    </div>
</asp:Content>
<asp:Content ContentPlaceHolderID="Footer" runat="server">    
    <%= Html.RenderScript("../../Scripts/Map.js") %>
</asp:Content>
